Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

Previous | Chapter Top | Chapter Contents

Component Manager Reference

Constants

The Component Alias Resource Type

enum {
    kComponentAliasResourceType= FOUR_CHAR_CODE('thga')/* component alias resource type
*/
};

Constant description

kComponentAliasResourceType
The resource type of a component alias resource.

Data Types

The Component Alias Resource Structure

The ComponentAliasResource structure is defined as follows:

struct ComponentAliasResource {
    ComponentResource      cr;  /* registration parameters */
    ComponentDescription   aliasCD;/* target description */
};

Field descriptions

cr
Contains information needed to register the component. This information is used in the same way as registration information for ordinary components, with one exception: the specification of the code resource for the component is ignored.
aliasCD
Specifies the target for the alias. To resolve a component alias, the Component Manager passes the contents of this field to the FindNextComponent function. The code resource of the target is used in place of the code resource specified in the cr field.

Functions

Dispatching to Component Routines

CallComponentFunctionWithStorageProcInfo

To use the new CallComponentFunctionWithStorageProcInfo function, your component will need to link with ComponentsInterfacesLib.

pascal long CallComponentFunctionWithStorageProcInfo(
                     Handle storage,
                     ComponentParameters *params,
                     ProcPtr func,
                     long funcProcInfo);
storage
A handle to the memory associated with the current connection. The Component Manager provides this handle to your component along with the request.
params
The component parameters record that your component received from the Component Manager.
func
The address of the function that is to handle the request. The Component Manager calls the routine referred to by the func parameter as a Pascal function with the parameters that were originally provided by the application. These parameters are preceded by a handle to the memory associated with the current connection. The routine referred to by the func parameter must return a function result of type ComponentResult (a long integer) indicating the success or the failure of the operation.
Note that for PowerPC code, the func parameter should still point to the routine itself--not to a RoutineDescriptor or Universal Procedure Pointer.
funcProcInfo
The procedure information for the routine referred to by the func parameter. See Inside Macintosh: PowerPC System Software, pages 2-14 through 2-21 for information on procedure information data.

Finding Components

GetComponentTypeModSeed

The GetComponentTypeModSeed function allows you to determine if the specified type of registered component has changed. This function returns the value of the component registration seed number for the specified component type. By comparing this value to values previously returned by this function, you can determine whether the component registry for the specified type has changed.

pascal long GetComponentTypeModSeed (OSType componentType);
componentType
A four-character code that identifies the type of component. All components of a particular type support a common set of interface routines. Your application uses this field to search for components of a given type.
function result
Returns a long integer containing the component registration seed number. Each time the Component Manager registers or unregisters a component, it generates a new, unique seed number.

DISCUSSION

This function is similar to the GetComponentListModSeed function. Unlike GetComponentListModSeed , the GetComponentTypeModSeed function is specific to a single component type. This allows you to know if, for example, the registration of image decompressor (` imdc ') components has changed regardless of other component changes.

Opening and Closing Components

OpenAComponent

The OpenAComponent function is similar to OpenComponent , except that its return value is an OSErr . The ComponentInstance of the newly opened component is passed back through the ci argument.

pascal OSErr OpenAComponent (
                     Component aComponent,
                     ComponentInstance *ci);
aComponent
A component identifier that specifies the component to open. Your application obtains this identifier from the FindNextComponent function. If your application registers a component, it can also obtain a component identifier from the RegisterComponent or RegisterComponentResource function.
ci
A pointer to a field to receive the ComponentInstance of the newly-opened component.

OpenADefaultComponent

The OpenADefaultComponent function is similar to OpenDefaultComponent , except that its return value is an OSErr . The ComponentInstance of the newly opened component is passed back through the ci argument.

pascal OSErr OpenADefaultComponent (
                     OSType componentType,
                     OSType componentSubType,
                     ComponentInstance *ci);
componentType
A four-character code that identifies the type of component. All components of a particular type support a common set of interface routines. Your application uses this field to search for components of a given type.
componentSubType
A four-character code that identifies the subtype of the component. Different subtypes of a component type may support additional features or provide interfaces that extend beyond the standard routines for a given component type. For example, the subtype of an image compressor component indicates the compression algorithm employed by the compressor.
Your application can use the componentSubType field to perform a more specific lookup operation than is possible using only the componentType field. For example, you may want your application to use only components of a certain component type (` draw ') that also have a specific subtype (` oval '). Set this parameter to 0 to select a component with any subtype value.
ci
A pointer to a field to receive the ComponentInstance of the newly-opened component.

Accessing a Component's Resource File

OpenAComponentResFile

The OpenAComponentResFile function is similar to OpenComponentResFile , except that its return value is an OSErr . The resource reference number of the newly opened component file is passed back through the resRef argument.

pascal OSErr OpenAComponentResFile (
                     Component aComponent,
                     short *resRef);
aComponent
A component identifier that specifies the component whose resource file you want to open. Your application can obtain this identifier from the RegisterComponentResource or FindNextComponent functions, or it can be a ComponentInstance (in which case it's the result of OpenAComponent or OpenADefaultComponent ).
resRef
A pointer to a field to receive the resource reference number of the newly opened component resource file.
resRef
 

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents